package com.ma.workorder;

import android.os.Bundle;

import com.ma.BR;
import com.ma.R;

import java.util.ArrayList;
import java.util.List;

import base.BaseListActivity;
import database.dao.DBManager;
import database.dao.GdbDao;
import database.table.Gdb;
import entity.Order;

public class ProcessedActivity extends BaseListActivity<Gdb> {

    @Override
    protected int getLayoutId() {
        return R.layout.pending_item;
    }

    @Override
    protected int getViewModelId() {
        return BR.gdBean;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        adapter.setOnItemClickListener((view, position) -> {
            startActivity(ProcessedOrderInfoActivity.class);

        });

    }

    @Override
    protected void onResume() {
        super.onResume();
        initData();
    }

    void  initData(){
        List<Gdb> orders=   DBManager.get().getGdbDao().queryBuilder().where(GdbDao.Properties.GDB_SFWC.eq(true)).build().list();
          setData(orders);

    }


}
